package cn.shiwei.user.domain;

import cn.shiwei.basic.domain.BaseDomain;
import cn.shiwei.basic.util.MD5Utils;
import cn.shiwei.basic.util.StrUtils;
import lombok.Data;

@Data
public class Logininfo extends BaseDomain {

    private String username;
    private String phone;
    private String email;
    private String salt;
    private String password;
    private Integer type;
    private Integer disable;

    public Logininfo() {
    }
    public Logininfo(String phone, String password, Integer type) {
        this.username =phone;
        this.phone = phone;
        this.salt = StrUtils.getComplexRandomString(32);
        // 加盐加密
        this.password = salt + MD5Utils.encrypByMd5(password);
        this.type = type;
    }

}
